home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9524 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.pi.net!news
  2. From: cat.tech@pi.net (Remy Cool)
  3. Newsgroups: comp.lang.c++
  4. Subject: Problem: ERROR: Cannot convert 'const void * ' to ' const HBITMAP_* '
  5. Date: Sat, 02 Mar 1996 11:07:41 GMT
  6. Organization: Cool Applied Technology
  7. Message-ID: <4h9a8h$89i@neptunus.pi.net>
  8. Reply-To: cool@pi.net
  9. NNTP-Posting-Host: hen19.pi.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. I have the folowing problem :
  13.  
  14. In the online help from BTC++ > BitBlt function,  is an example on how to show Bitmaps from the
  15. Resource on the screen.
  16.  
  17.  
  18. /* code as described in online help BitBlt function */
  19.  
  20. Void TMyWindow:: ........
  21. {
  22. HDC hdc, hdcMemory;
  23. HBITMAP hbmpGraphic, hbmpOld;
  24. BITMAP bm;
  25.  
  26. hbmpGraphic = LoadBitmap(GetApplication()->hInstance, "MyBitmap");
  27. GetObject(hbmpGraphic, sizeof(BITMAP), &bm);
  28.  
  29. hdc = GetDC(HWindow);
  30. hdcMemory = CreateCompatibleDC(hdc);
  31. hbmpOld = SelectObject(hdcMemory, hbmpGraphic);    // >>> Line 98
  32.  
  33. BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMemory, 0, 0, SRCCOPY);
  34. SelectObject(hdcMemory, hbmpOld);
  35.  
  36. DeleteDC(hdcMemory);
  37. ReleaseDC(HWindow, hdc);
  38. }
  39.  
  40. When I use this code in my program, I get the following Compiler Error.
  41.  
  42. Compiling MyApp.CPP:
  43. Error MyApp.CPP 98: Cannot convert 'const void *' to 'const HBITMAP__ *'
  44.  
  45. What is wrong with it and what's the solution ?
  46.  
  47. Regards,
  48.  
  49. Remy
  50.  
  51.  
  52.  
  53.  
  54.  
  55.